package cn.gok.factory;

import cn.gok.entity.Car;

/**
    静态工厂方法：
        通过StaticCarFactory.newInstance即可获Car对象
 */

public class StaticCarFactory {

    public static Car newInstance(){
        System.out.println("通过静态工厂方法创建car对象");
        Car car = new Car();
        car.setCarName("xxx");
        car.setCarType("货车");
        return car;
    }
}
